package com.qn.example.mapper;

import com.qn.example.pojo.Category;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 21276
 * @version 1.0
 * @date 2023/5/4 14:26
 */
public interface CategoryMapper {

    @Select("select * from category order by sort desc")
    List<Category> findByPage(Object o);

    //新增员工信息
    @Insert("insert into category value(null,#{type},#{name},#{sort},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void save(Category category);

    void updateEmp(Category category);

    @Delete("delete from category where id = #{id}")
    void deleteId(Long id);


    List<Category> foodClassNames(@Param("type") Integer type);



    @Select("select * from category where id =#{categoryId}")
    Category findById(Long categoryId);
}
